Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tensorflow: add tf.distribute.experimental.coordinator.RemoteValue #11349

Conversation

hoel-bagard
Copy link
Contributor

This class is only available in tensorflow>=2.15 (cf documentation).

This comment has been minimized.

@hoel-bagard hoel-bagard changed the title add tf.distribute.experimental.coordinator.RemoteValue tensorflow: add tf.distribute.experimental.coordinator.RemoteValue Feb 1, 2024
@hoel-bagard hoel-bagard force-pushed the hoel/add_distribute.experimental.coordinator branch from 3bed77d to b6ae7c9 Compare February 4, 2024 03:47

This comment has been minimized.

@hoel-bagard hoel-bagard force-pushed the hoel/add_distribute.experimental.coordinator branch from b07ed76 to e51face Compare February 4, 2024 04:05
@hoel-bagard
Copy link
Contributor Author

hoel-bagard commented Feb 4, 2024

@hmc-cs-mdrissi This PR is getting the following import error, but I don't understand why:

error: tensorflow.distribute.experimental.coordinator failed to import. Maybe install the runtime package or alter PYTHONPATH? ModuleNotFoundError: No module named 'tensorflow.distribute.experimental.coordinator'

Probably unrelated, but in a previous PR I had to make this commit to change an import in order for CI to pass. I understand that TensorFlow's imports are a bit cursed, but I was a bit surprised to have to do that in the stubs.

@hoel-bagard hoel-bagard force-pushed the hoel/add_distribute.experimental.coordinator branch from 0a7fece to e51face Compare February 4, 2024 04:11

This comment has been minimized.

@hmc-cs-mdrissi
Copy link
Contributor

# Tensorflow imports are cursed.
is a similar example. For some documented types importing it from module vs accessing it by attribute so,

from tensorflow.distribute.experimental.coordinator import RemoveValue

vs

import tensorflow as tf

tf.distribute.experimental.coordinator.RemoteValue

one works, other crashes. I don't know any way to describe this behavior in stubs. It's undocumented behavior and side effect of weird import magic tensorflow does. Maybe future version/issue will fix this and make both ways work. I recommend stubtest allowlist with a comment of cursed import magic.

@hoel-bagard hoel-bagard marked this pull request as ready for review February 5, 2024 13:57

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Feb 8, 2024

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit 69354d7 into python:main Feb 17, 2024
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants